﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Windows;

namespace TV_Organizer
{
    /// <summary>
    /// Logique d'interaction pour FoldersSelectionWindow.xaml
    /// </summary>
    public partial class CollectionEditorWindow : Window
    {
        public CollectionEditorWindow(IList itemsSource, Type objectsType)
        {
            InitializeComponent();

            this.CollectionEditor.ItemsSource = itemsSource;
            this.CollectionEditor.ItemsSourceType = objectsType;
            this.CollectionEditor.NewItemTypes = new List<Type>
            {
                objectsType,
            };
        }

        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            this.CollectionEditor.PersistChanges();
            this.DialogResult = true;
            this.Close();
        }

        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
            this.Close();
        }
    }
}
